package com.pearadmin.pro.modules.recruit.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.recruit.domain.ScrmSysRecruit;
import com.pearadmin.pro.modules.recruit.param.ScrmSysRecruitRequest;
import com.pearadmin.pro.modules.recruit.repository.ScrmSysRecruitRepository;
import com.pearadmin.pro.modules.recruit.service.ScrmSysRecruitService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
 * 招聘信息Service业务层处理
 *
 * @author chenJian
 * @date 2021-10-07
 */
@Service
public class ScrmSysRecruitServiceImpl extends ServiceImpl<ScrmSysRecruitRepository, ScrmSysRecruit> implements ScrmSysRecruitService
{
    @Resource
    private ScrmSysRecruitRepository scrmSysRecruitRepository;

    /**
     * 查询招聘信息
     * @param request
     * @return 招聘信息 分页集合
     * */
    @Override
    public PageResponse<ScrmSysRecruit> page(ScrmSysRecruitRequest request)
    {
        LambdaQueryWrapper<ScrmSysRecruit> query = new LambdaQueryWrapper<ScrmSysRecruit>();
        return Pageable.of(request,(()->  scrmSysRecruitRepository.selectList(query)));
    }
    /**
     * 保存招聘信息
     *
     * @param id 招聘信息ID
     * @return 招聘信息
     */
    @Override
    public boolean saveOrUpdate(ScrmSysRecruit request) {
        return save(request);
    }

    /**
     * 查询招聘信息
     *
     * @param id 招聘信息ID
     * @return 招聘信息
     */
    @Override
    public ScrmSysRecruit selectScrmSysRecruitById(Long id)
    {
        return scrmSysRecruitRepository.selectById(id);
    }

}
